package com.nix.fileresolution.excel.read;

import com.nix.fileresolution.Read;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

/**
 * @author zhangpei
 * @Email zhangpe0312@qq.com
 * @day 2017/12/3 20:41
 * @Use 获取一行的数据
 */
public class ReadExcel extends ExcelProcessor implements Read {
    /**
     * 一个单位存一行数据
     * 该数组存表里所有数据
     */
    private ArrayList<XRow> rows = new ArrayList<XRow>();

    public ReadExcel(String fileName) throws Exception {
        super(fileName);
    }

    /**
     * 获取一行的数据
     *
     * @param row
     */
    @Override
    public void processRow(XRow row) {
        rows.add(row);
    }

    @Override
    public void processRowResult(boolean isOK) {

    }

    @Override
    public ArrayList<XRow> read() {
        return rows;
    }

}
